1. Field of the Invention
The present invention relates to a numerical controller for controlling a position of a servomotor or controlling a position of a control axis which is driven and controlled by the servomotor, and more particularly, to a numerical controller which starts carrying out positional control by applying current to a servomotor (movable portion) when the servomotor is coasting in a state where no current flows to the servomotor.
2. Description of the Related Art
In a numerical controller which drives a control axis of a movable portion of a machine or the like to control a position of the control axis, a position loop control is usually carried out to control a position of the control axis.
There is a known numerical controller in which when the servomotor is driven and controlled by a controller to control a position of control object up to a target position and then control other than position control of the control object is carried out by the controller, the controller sets a target position in a deviation counter which stores a deviation between a command position of the control object and the actual position thereof, holds the target position by the deviation counter (carries out substantial position control), and the controller carries out operation controls other than position control of the control object (see Japanese Patent Application Laid-open No. 1-314130).
There is also known a die-casting machine or a press machine in which a movable mold (control axis) is driven by a servomotor to open and close a mold, wherein, when the mold is to be opened, as a large force is required, application of current to the servomotor which drives the movable mold is stopped so that no current flows in the servomotor (hereinafter this state is called “servo-off state”) and a workpiece and the movable mold are pushed out by hydraulic pressure from the side of the stationary mold, and when the mold is opened and the movable mold is coasting, on the other hand, current is applied to the servomotor (hereinafter this state is called “servo-on state”), and a position of the movable mold (control axis) is controlled.
When servo-off state where the servomotor and the movable portion are coasting is changed into servo-on state and position control is started in servo-on state, there is a problem that the speeds of the servomotor and the control axis are once reduced and then sharply increased due to the influence of the position deviation counter (position deviation) used for position control, with the result that they can not move smoothly.
FIG. 12 shows a variation in the speed of a servomotor occurred when position control is started in servo-on state which is switched over from servo-off state where the servomotor (control axis) is coasting. When no current is applied to the servomotor in a servo-off state, position control of the servomotor is not carried out. Therefore, only a position feedback signal from a position detector mounted on the servomotor or the like is input to the position deviation counter which stores a position deviation between a command position and the actual position, and a movement amount by the coasting of the servomotor is stored in the position deviation counter. For example, assuming that, when a servomotor gets into servo-off state, the servomotor is pushed out in the positive direction due to an external force so that the servomotor moves in the positive direction, the position feedback signal serves to subtract the value of the position deviation counter, with the result that negative position deviation is increased.
If the servomotor gets into servo-on state and position control is again started, the servomotor which is coasting in the positive direction is driven in a negative position by the negative position deviation stored in the position deviation counter, and the servomotor is abruptly decelerated or reversely rotated. Then, the servomotor is accelerated by a position command according to the position control. As a result, as shown in FIG. 12, there is a problem that, when position control is started when servo-off state is switched over to servo-on state, abrupt speed change caused by abrupt speed reduction and subsequent speed increase is brought about so that the servomotor cannot move smoothly. Even if the value of the position deviation counter is periodically cleared to “0” by follow up processing, a position deviation remains in the position deviation counter dependent on timing on servo-on state so that the above-described speed variation is caused.